package com.example.aiquestions.factory;

import com.example.aiquestions.service.AIService;
import com.example.aiquestions.service.impl.DeepseekServiceImpl;
import com.example.aiquestions.service.impl.KimiServiceImpl;
import com.example.aiquestions.service.impl.QianwenServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class AIServiceFactory {

    @Autowired
    private DeepseekServiceImpl deepseekService;

    @Autowired
    private KimiServiceImpl kimiService;

    @Autowired
    private QianwenServiceImpl qianwenService;

    public AIService getService(String provider) {
        return switch (provider.toLowerCase()) {
            case "deepseek" -> deepseekService;
            case "kimi" -> kimiService;
            case "qianwen" -> qianwenService;
            default -> throw new IllegalArgumentException("Unsupported AI provider: " + provider);
        };
    }
} 